Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Matrix

Hierarchy

  • Matrix

Index

Constructors

constructor

  • new Matrix(data: number[][]): Matrix

Properties

Private self

self: number[][]

shape

shape: [number, number]

Accessors

T

Methods

addition

adjugate

  • 伴随矩阵

    • n阶:A(i,j) = (-1)^(i+j) * M(i,j)
    • 2阶:主对角线元素互换,副对角线元素变号
    • 1阶:伴随矩阵为一阶单位方阵

    Returns Matrix

argMax

  • argMax(row: number): number
  • 返回行的最大值索引

    Parameters

    • row: number

    Returns number

atomicOperation

  • atomicOperation(callback: (item: number, row: number, col: number) => number): Matrix
  • 矩阵元素的原子操作

    Parameters

    • callback: (item: number, row: number, col: number) => number
        • (item: number, row: number, col: number): number
        • Parameters

          • item: number
          • row: number
          • col: number

          Returns number

    Returns Matrix

clone

coLocationOperation

  • coLocationOperation(b: Matrix, oper: "add" | "sub" | "mul" | "exp"): Matrix

columnSum

cominor

  • cominor(row: number, col: number): Matrix
  • 筛选余子式矩阵

    Parameters

    • row: number

    • col: number

    Returns Matrix

connect

dataSync

  • dataSync(): number[][]
  • 返回拷贝后的二维数组

    Returns number[][]

det

  • det(): number

equals

equalsShape

  • equalsShape(b: Matrix): boolean

expand

  • expand(n: number, position: "L" | "R" | "T" | "B"): Matrix
  • 向矩阵上下左右追加一列/行

    Parameters

    • n: number
    • position: "L" | "R" | "T" | "B"

    Returns Matrix

get

  • get(row: number, col: number): number
  • 根据索引获取元素

    Parameters

    • row: number
    • col: number

    Returns number

getCol

  • getCol(col: number): number[]
  • 根据索引获取列

    Parameters

    • col: number

    Returns number[]

getMeanOfRow

  • getMeanOfRow(row: number): number
  • 获取某一行的均值

    Parameters

    • row: number

    Returns number

getRow

  • getRow(row: number): number[]
  • 根据索引获取行

    Parameters

    • row: number

    Returns number[]

inverse

multiply

normalization

print

  • print(): void

slice

  • slice(start: number, end: number): Matrix
  • 上下分割矩阵

    Parameters

    • start: number
    • end: number

    Returns Matrix

subtraction

sum

  • sum(): number
  • 矩阵所有值求和

    Returns number

update

  • update(row: number, col: number, val: number, oper?: "+=" | "-=" | "*=" | "/="): void
  • 更新原矩阵

    Parameters

    • row: number
    • col: number
    • val: number
    • Optional oper: "+=" | "-=" | "*=" | "/="

    Returns void

zeroed

Static generate

Generated using TypeDoc